import {isAuth} from '../utils/token'
import {Navigate} from 'react-router-dom'
export default function AuthComponent({children}){
    const isToken=isAuth()
    if(isToken){
        console.log('---------我有token--------------');
        return <>{children}</>
    }else{
        return <Navigate to='/login' replace={true}></Navigate>
    }
}
